package com.example.hello;

import com.example.hello.client.NavText.BootstrapNavTextState;
import com.vaadin.ui.AbstractComponent;

public class BootstrapNavText extends AbstractComponent {

    public BootstrapNavText() {
        this("");
    }

    public BootstrapNavText(String text) {
        this(text, BootstrapNav.Alignment.NONE);
    }

    public BootstrapNavText(String text, BootstrapNav.Alignment alignment) {
        setAlignment(alignment);
        setText(text);
    }

    @Override
    protected BootstrapNavTextState getState() {
        return (BootstrapNavTextState) super.getState();
    }

    public BootstrapNav.Alignment getAlignment() {
        return BootstrapNav.Alignment.valueOf(getState().getAlignment());
    }

    public String getText() {
        return getState().getText();
    }

    public void setAlignment(BootstrapNav.Alignment alignment) {
        getState().setAlignment(alignment.toString());
    }

    public void setText(String text) {
        getState().setText(text);
    }

}